<template>
  <el-container style="height: 100%; border: 1px solid #eee">
    <el-header style="font-size: 16px">
      <h1>XX后台管理系统</h1>
      <el-dropdown>
        <i class="el-icon-setting" style="margin-right: 15px"></i>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>查看</el-dropdown-item>
          <el-dropdown-item>修改密码</el-dropdown-item>
          <el-dropdown-item>退出登录</el-dropdown-item>
        </el-dropdown-menu>
        <span>{{username}}</span>
      </el-dropdown>
    </el-header>

    <el-container>    
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <v-nav></v-nav>
      </el-aside>
   
      <el-main>
        <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>

<style scoped>
  body {
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  .el-header {
    display: flex;
    justify-content: space-between;
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }

  .el-header h1 {
    margin: 0;
    display: inline-block;
  }
  
  .el-aside {
    color: #333;
  }
</style>

<script>
  import vNav from '../components/Navigate.vue'

  export default {
    data() {
      return {
        username: ''
      }
    },
    components: {
      vNav,
    },
    mounted() {
      this.username = JSON.parse(sessionStorage.getItem('userInfo')).username
    }
  };
</script>
